Skip to main content

Code Checks

We strongly encourage to keep the code checks in place and add more if possible, but it is always possible to update the configuration for the different types of checks: linting, unit tests, Sonar.

We use Husky for handling Git hooks. You can check and update the configuration in the package.json, under the husky property.

Linting

We use ESLint for linting the JS files, along with Prettier with formatting. We provide a set of rules from @accedo/eslint-config-vdkweb that you can always customize. You can also try our more-strict version @accedo/eslint-config-vdkweb-strict whic is what we use in our internal packages.

The configuration files are .eslintrc.js and .eslintignore.

You can run the linting with:

npm run lint:js

Many of the errors can be automatically fixed, you can run:

npm run lint:js:fix

Because of this, we highly recommend to setup your editor so many ESLint errors will be automatically fixed when saving the file. All of the mainstream editors support this via plugins or key strokes.

For the *.scss files we use stylelint, which has a similar approach as ESLint. The configuration file is .stylelintrc.js. To run it:

npm run lint:css # this will cover SCSS files too

And like ESLint, many rules can be fixed:

npm run lint:css:fix

SonarCloud

Elevate CTV has a manual integration with SonarCloud, this is available, as per any other repo, seamslessly through Github and it allows both PR and main branch validation with a little configuration on SonarCloud side.